Wiki

Clone wiki

codetrainer / Building portaudio with Visual Studio

Portaudio can be compiled by generating Visual Studio with cmake. Since cmake was one of the prerequisites you should already have it installed.

Don't foget to set PORTAUDIO_PATH environment variable to the location portaudio is installed (C:\Code\portaudio in this case)

Steps to create Visual Studio projects:

  • Open cmake-gui application (it is installed with cmake)
  • Select the folder where you extracted portaudio (C:\Code\portaudio in my case)
  • Set the output folder as bin directory in the folder where portaudio was extracted (C:\Code\portaudio\bin in my case)
  • When you press configure you should have the following image (select Yes to create the bin folder)

cmake_gui_build_portaudio.png

  • Select the Visual Studio version you're using (10 is for VS 2010, 11 is for VS 2012, 12 is for VS 2013 ...). Choose the 32 bit version of Visual Studio (this means not to choose the Win64 version).
  • Click generate
  • Go to the bin (C:\Code\portaudio\bin in my case) folder and open portaudio.sln with your Visual Studio version
  • Select to build at least the Debug configuration and choose Build Solution after selecting the configuration. If you receive this error (2>LINK : fatal error LNK1104: cannot open file 'ksguid.lib') then you must do the following:

    • Right click on the portaudio project and add PA_WDMKS_NO_KSGUID_LIB to the list of preprocessor defines. Follow the steps from the image below:PA_WDMKS_NO_KSGUID_LIB.png
  • Do again the build of the solution !

  • Check that Debug folder was created in the bin directory and contains at least portaudio_x86.lib and portaudio_x86.dll
  • If you find the specified files at the previous step then you have build the Debug configuration correctly

Updated